package com.cloudpivot.receivales;

import com.cloudpivot.receivales.contract.entity.erpcontract.*;
import com.cloudpivot.receivales.contract.service.http.HttpAPIServiceForCrm;
import com.cloudpivot.receivales.contract.service.impl.CrmContractServiceImpl;
import com.cloudpivot.receivales.contract.service.impl.ErpContractServiceImpl;
import com.cloudpivot.receivales.contract.util.StrUtil;
import com.cloudpivot.receivales.invoice.services.LdtWorkflowServiceResultsImpl;
import com.cloudpivot.receivales.invoice.util.RsaEncryptionUtil;
import com.google.gson.JsonObject;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.crypto.Cipher;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.spec.X509EncodedKeySpec;
import java.util.Arrays;
import java.util.Base64;
import java.util.Date;
import java.util.Map;

import static com.cloudpivot.receivales.contract.util.StrUtil.dateTimeToDate;
import static com.cloudpivot.receivales.contract.util.StrUtil.newGuid;

@SpringBootTest
class CloudpivotApplicationTest2 {

    @Autowired
    private HttpAPIServiceForCrm httpAPIServiceForCrm;
    @Autowired
    private ErpContractServiceImpl erpContractService;

    /**
     * 获取合同编号测试
     */
    @Test
    public void interfaceTest2() {
        String code = "ZJBSHT01220221008";

        System.out.println(StrUtil.contractIdAdd(code));

    }

    @Test
    public void interface3() {

        System.out.println("最终获取可用的id："+erpContractService.getLastContractId());

    }
}
